package com.yd.util;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;


public class ConstateFinalUtil
{
     public static Logger logger=LogManager.getLogger(ConstateFinalUtil.class);
     
     public static JSONObject RESOURCE_JSON=new JSONObject();
     
     public static JSONObject INFO=new JSONObject();
     
     static
 	{
 		/* 读取JSON配置文件 */
 		readFileUtil fileUtil = new readFileUtil();
 		String resourceStr = "" ; 
 		try
 		{
 			resourceStr = fileUtil.readFile(ConstateFinalUtil.class.getClassLoader().getResourceAsStream("info.json"));
 			RESOURCE_JSON = (JSONObject) JSON.parse(resourceStr);
 			
 			/* 获取json配置文件中info信息 */
 			INFO = RESOURCE_JSON.getJSONObject("info");
 			ConstateFinalUtil.logger.info("JSON配置文件");
 		} catch (Exception e)
 		{
 			ConstateFinalUtil.logger.info("JSON配置文件转换报错了,字符串:{}",resourceStr,e);
 		}
 	}
}
